<template>
  <div>
    <CategorySelector :disabled="isShow !== 1"/>
    <!-- 
        三个组件切换用1,2,3
        1,显示 SpuList
        2,显示 AddOrUpdateSpu 
        3,显示 AddSku
     -->
    <SpuList v-if="isShow === 1"  @setIsShow="setIsShow"/>
    <AddOrUpdateSpu v-else-if="isShow === 2"  @setIsShow="setIsShow"/>
    <AddSku v-else  @setIsShow="setIsShow"/>
  </div>
</template>

<script>
import SpuList from './components/SpuList.vue'
import CategorySelector from '@/components/CategorySelector/index.vue'
import AddOrUpdateSpu from "./components/AddOrUpdateSpu.vue";
import AddSku from './components/AddSku.vue'
export default {
  name: 'spu',
  components:{
    CategorySelector,
    SpuList,
    AddOrUpdateSpu,
    AddSku
  },
  data() {
    return {
      isShow:1   
    }
  },
  methods: {
    setIsShow(val){
      // console.log(val);
      this.isShow = val
    }
  },
 
  
}
</script>

<style scoped>

</style>
